﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using Lime49;

namespace LockCrypt.Core {
    [Flags]
    public enum FieldMetaData {
        None = 0,
        Password = 1,
        Url = 2,
        Phone = 4
    }

    public enum EncryptionProviders {
        [EnumBinder.EnumDescription("None")]
        None,
        [EnumBinder.EnumDescription("Aes (256 bit)")]
        Aes256,
        [EnumBinder.EnumDescription("TwoFish (256 bit)")]
        TwoFish256
    }

    public static class Constants {
        /// <summary>
        /// Gets the application version.
        /// </summary>
        /// <returns>The application version.</returns>
        public static Version GetVersion() {
            return System.Reflection.Assembly.GetCallingAssembly().GetName().Version;
        }

        /// <summary>
        /// Gets the date the assembly was compiled.
        /// </summary>
        public static DateTime BuildDate = Utils.RetrieveLinkerTimestamp();

        /// <summary>
        /// Types available for Import/Export
        /// </summary>
        [Flags]
        public enum DataType {
            Auto,
            [EnumBinder.EnumDescription("LockCrypt Legacy XML")]
            LegacyXML,
            [EnumBinder.EnumDescription("LockCrypt XML File")]
            XML,
            [EnumBinder.EnumDescription("SQLite Database")]
            SQLite,
            [EnumBinder.EnumDescription("LockCrypt Legacy Database")]
            Legacy,
            HTML,
            CSV,
            [EnumBinder.EnumDescription("Keepass 2.x XML File")]
            Keepass2x
        }

        /// <summary>
        /// Types of database provider available
        /// </summary>
        [Flags]
        public enum DatabaseType {
            [EnumBinder.EnumDescription("LockCrypt XML File")]
            XML,
            [EnumBinder.EnumDescription("SQLite Database")]
            SQLite,
            [EnumBinder.EnumDescription("LockCrypt Legacy")]
            Legacy,
            MySQL
        }

        /// <summary>
        /// Available application languages.
        /// </summary>
        public static Dictionary<string, CultureInfo> Languages = new Dictionary<string, CultureInfo>() {// new Comparers.CultureInfoEnglishNameComparer(), StringComparer.InvariantCultureIgnoreCase) {
            {"ar-MA", CultureInfo.GetCultureInfo("ar-MA")},
            {"bg-BG", CultureInfo.GetCultureInfo("bg-BG")},
            {"cs-CZ", CultureInfo.GetCultureInfo("cs-CZ")},
            {"da-DK", CultureInfo.GetCultureInfo("da-DK")},
            {"de-DE", CultureInfo.GetCultureInfo("de-DE")},
            {"en-GB", CultureInfo.GetCultureInfo("en-GB")},
            {"en-GB-IK", CultureInfo.GetCultureInfo("en-GB-IK")},
            {"es-ES", CultureInfo.GetCultureInfo("es-ES")},
            {"fr-FR", CultureInfo.GetCultureInfo("fr-FR")},
            {"hu-HU", CultureInfo.GetCultureInfo("hu-HU")},
            {"it-IT", CultureInfo.GetCultureInfo("it-IT")},
            {"ka-GE", CultureInfo.GetCultureInfo("ka-GE")},
            {"pl-PL", CultureInfo.GetCultureInfo("pl-PL")},
            {"ru-RU", CultureInfo.GetCultureInfo("ru-RU")},
            {"sl-SI", CultureInfo.GetCultureInfo("sl-SI")},
            {"zh-CN", CultureInfo.GetCultureInfo("zh-CN")},
            {"zh-TW", CultureInfo.GetCultureInfo("zh-TW")}
        };

        public const string DefaultIcon = "default";
        public const string DefaultGroupIcon = "folder_closed";

        /*public static string[] Icons = new[] {
            "address","car","creditcard","email","flag_blue",
            "flag_green","flag_red","flag_yellow","keys",
            "network","padlock","phone","pirate",
            "user_group","user_office","home",
            "medicine","medicine2","music","paint","default"
        };*/
    }
}
